package com.one.api.common.msg.entity;

import com.one.api.common.msg.entity.body.MsgBody;
import net.sf.json.JSONObject;

public class Msg {
    private MsgHead head;
    private MsgBody body;

    public static Msg build(){
        Msg content=new Msg();
        content.setHead(MsgHead.build());
        return content;
    }

    public static Msg build(MsgBody body){
        Msg content=build();
        content.setBody(body);
        return content;
    }

    @Override
    public String toString() {
        return JSONObject.fromObject(this).toString();
    }

    public MsgHead getHead() {
        return head;
    }

    public void setHead(MsgHead head) {
        this.head = head;
    }

    public MsgBody getBody() {
        return body;
    }

    public void setBody(MsgBody body) {
        this.body = body;
    }
}
